package com.ping.study.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvc implements WebMvcConfigurer {

    // 原有的 NBA WebClient
    @Bean("nbaWebClient")
    public WebClient nbaWebClient() {
        return WebClient.create("https://api.nba.cn/sib/v2");
    }

    // 新增的腾讯视频 WebClient
    @Bean("tencentWebClient")
    public WebClient tencentWebClient() {
        return WebClient.create("https://infozb6.video.qq.com");
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
